
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
cli-testing-library
Advanced tools
Simple and complete CLI testing utilities that encourage good testing practices.
Simple and complete CLI testing utilities that encourage good testing practices.
This project is not affiliated with the "Testing Library" ecosystem that this project is clearly inspired from. We're just big fans :)
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed as one of your project's devDependencies
:
npm install --save-dev cli-testing-library
This is currently the only section of "usage" documentation. We'll be expanding it as soon as possible
Usage example:
const {resolve} = require('path')
const {render} = require('cli-testing-library')
test('Is able to make terminal input and view in-progress stdout', async () => {
const {cleanup, findByText, queryByText, userEvent} = await render('node', [
resolve(__dirname, './execute-scripts/stdio-inquirer.js'),
])
const instance = await findByText('First option')
expect(instance).toBeInTheConsole()
expect(await findByText('❯ One')).toBeInTheConsole()
cleanup()
userEvent('[ArrowDown]')
expect(await findByText('❯ Two')).toBeInTheConsole()
cleanup()
userEvent.keyboard('[Enter]')
expect(await findByText('First option: Two')).toBeInTheConsole()
expect(await queryByText('First option: Three')).not.toBeInTheConsole()
})
For a API reference documentation, including suggestions on how to use this library, see our documentation introduction with further reading.
While this library does work in Windows, it does not appear to function properly in Windows CI environments, such as GitHub actions. As a result, you may need to either switch CI systems or limit your CI to only run in Linux
If you know how to fix this, please let us know in this tracking issue
Thanks goes to these wonderful people (emoji key):
Corbin Crutchley 💻 📖 🚧 | Bitcollage 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Simple and complete CLI testing utilities that encourage good testing practices.
The npm package cli-testing-library receives a total of 1,742 weekly downloads. As such, cli-testing-library popularity was classified as popular.
We found that cli-testing-library demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.